POV-Ray : Newsgroups : povray.newusers : Attaching a vector to an object : Attaching a vector to an object Server Time
28 Jul 2024 14:24:52 EDT (-0400)
  Attaching a vector to an object  
From: Bill
Date: 18 Nov 2008 12:10:00
Message: <web.4922f5c93f11211224b378250@news.povray.org>
Let me start by saying this was easier to do in POV3.1 than 3.6.1. And I have no
explanation as to why. So I am asking the POV Gurus for help.

I have a set of programs that create pov files that I render for animation
purposes.
The setup is this.
There are two aircrafts (World War I style).
The view point is the cockpit of the snipe.
Each plane will be twisting and turning and doing what fighter planes do. :)

Here is a sample scene.

#declare snipe_pos = <58.601052,1500.000000,100.000000>;
#declare snipe_rot = <0,0,12>;
#declare fok_pos = <59.034065,1500.000000,150.000000>;
#declare fok_rot = <0,60,0>;
#include "colors.inc"
#include "textures.inc"
#include "transforms.inc"
global_settings { ambient_light rgb<2,2,2> radiosity{} }
light_source{<0,5000,0> rgb<2,2,2> }
plane{<0,1,0>,1 hollow texture{ pigment{ bozo turbulence 0.92 color_map { [0.00
rgb <0.2, 0.2, 1>*0.9] [0.50 rgb <0.2, 0.2, 1>*0.9][0.70 rgb <1,1,1>][
0.85 rgb <0.25,0.25,0.25>][1.0 rgb <0.5,0.5,0.5>]} scale<1,1,1.5>*2.5
translate<1.0,0,-1> } finish {ambient 1 diffuse 0} } scale 10000 }
plane { <0,1,0>, 0 texture{ pigment{color rgb<0.35,0.65,0.0>*0.8} finish
{ambient 0.1 diffuse 0.8} } }
fog{distance 300000 color rgb <.5,.5,.5>}
#include "fok2.inc"
#include "snipe.inc"
object{fok rotate fok_rot translate fok_pos finish { ambient 1 diffuse .4 } }
object{snipe rotate snipe_rot translate snipe_pos finish { ambient 1 diffuse .4
}}
#local HeadPos = <0,3,4.3>;
#local hp = vtransform(HeadPos,Rotate_Around_Trans(snipe_rot, <0,0,0>));
#declare Cam0 = camera { location HeadPos+snipe_pos direction <0, 0,  1> up
  <0, 1,  0> right   <-1.7777777778, 0,  0> look_at   fok_pos }
camera{Cam0}

More info. The HeadPos is the offset of the center of gravity for the plane at
where the pilot's head should be.

Ok, here is the problem. In 3.1g I was able to define the location in the camera
then rotate and translate the camera to the same position as the snipe_pos
vector. In 3.6.1 this doesnt work at all. :(

So, I have been trying all sorts of things to help get me to where I need to be.
This setup with vtransform is the closest I have gotten to date, but it still
doesnt work right.

I would like the camera to be fixed to the snipe_pos+HeadPos when the plane is
rotated and transformed and still be able to specify look_at fok_pos.

This way no matter how the plane banks and yanks the camera will always be in
the position of the pilot's head.

Can anyone please help me kick this beast in the backside?

Bill


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.